package com.example.dormitorysystem.common.rabbitmq;

import com.example.dormitorysystem.entity.Orders;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author chen huilong
 * @data 2022/11/1
 */
@Component
public class SendOrderMessage {

    @Resource
    private AmqpTemplate rabbitTemplate;

    public void send(Orders order) {
        this.rabbitTemplate.convertAndSend("orders", order);
    }
}
